﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;
using MegaBitProject.Models;

namespace MegaBitProject.Controllers
{
    [Authorize]
    public class AdminController : Controller
    {
        IGameRepository rep = null;

        public AdminController()
        {
            rep = new GameRepository();
        }
        //
        // GET: /Admin/

        public ActionResult Admin()
        {
            var userList = from user in rep.getUser select user;
            return View(userList);
        }

        //public ActionResult Admin()
        //{
        //    if (Roles.IsUserInRole("Admin"))
        //    {
        //        var userList = (from user in rep.getUser 
        //                        select user);
        //        return View(userList);
        //    }
        //    else
        //    {
        //        return RedirectToAction("Index", "Home");
        //    }
        //}
    }
}
